package com.web.segment.matching.util;


import com.web.segment.matching.dictionary.HashDictionary;
import com.web.segment.matching.processor.MaxMatchSegmentProcessor;

public class Test {
	
	public static void main(String[] args) {
		
//		SimpleDictionary simpleDictionary = new SimpleDictionary();
//		simpleDictionary.insertWord("少年");
//		simpleDictionary.insertWord("间隔年");
//		simpleDictionary.insertWord("旅游");
		HashDictionary hashDictionary = new HashDictionary();
		hashDictionary.insertWord("少年");
		hashDictionary.insertWord("间隔年");
		hashDictionary.insertWord("旅游");
		String fileName = "E:\\delevoper\\file.tmp";
		DictionaryUtil<HashDictionary> dicUtil = new DictionaryUtil<HashDictionary>();
		dicUtil.writeDictionary(hashDictionary, fileName);
		
		
		MaxMatchSegmentProcessor maxMatchSegmentProcessor = new MaxMatchSegmentProcessor();
		
		maxMatchSegmentProcessor.textProcess("少年记得那天，我拖你去海滩，而它真少年如你所说的下了雨 我以为你会说“我告诉过你” ");
		
		
		boolean match = hashDictionary.match("少年1");
		
		System.out.println("match--->>" + match);
	}

}
